<?php

namespace app\front\controller;

use think\Controller;
use think\Request;
use think\Session;

class Besc extends Controller
{
//    书写一个基类
    public function __construct(Request $request = null)
    {
        parent::__construct($request);
        $res = Session::set('token');
        if (！isset($res)) {
            $this->error('没有登录，请先登录在访问其他页面', '/front/user/login');
        }
        $token = \Token::verify_token($res);
        if (!isset($token)) {
            $this->error('token值不正确', '/front/user/login');
        }
    }


}
